Skip to content

Add unittests for output_methods/file.py#978

Merged
inimaz merged 3 commits into
masterfrom
tests/fileoutput
Nov 22, 2025
Merged

Add unittests for output_methods/file.py#978
inimaz merged 3 commits into
masterfrom
tests/fileoutput

Conversation

@cianc

@cianc cianc commented Nov 20, 2025

Copy link
Copy Markdown
Contributor

Description

Add tests for file output.

Also:

  • Fix the "update" logic in FileOutput.out() when a single matching row exists. I do not think this ever worked due to passing an odict_keys to pandas.at instead of a tuple.
  • Add docstrings for file.py
  • Drop empty columsn before doing dataframe concatenations to prevent panda warnings.

Related Issue

Please link to the issue this PR resolves: #972

Motivation and Context

File output has no unit tests.

How Has This Been Tested?

All new and existing unittests run.

Screenshots (if appropriate):

Types of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

Go over all the following points, and put an x in all the boxes that apply.

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING.md document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Also:
* Add docstrings for file.py
* Drop empty columsn before doing dataframe concatenations to prevent panda warnings.
* Fix the "update" logic in FileOutput.out() when a single matching row exists.
@cianc cianc marked this pull request as ready for review November 20, 2025 13:25
@cianc cianc requested a review from a team as a code owner November 20, 2025 13:25

@inimaz inimaz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @cianc ! For the test and for spotting the issue on the update with one runID. This makes me wonder in which scenario we have more than one runID, since when len(df_run)==1 we update...

@inimaz inimaz merged commit 2a81596 into master Nov 22, 2025
8 checks passed
@cianc cianc deleted the tests/fileoutput branch November 22, 2025 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Tests] Add unit tests to the output methods

2 participants